<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
	</head>
	<body>
		<script>
			// 用户输入一个数字n 计算 3 / 2 + 4 / 4 + ... + (n + 1) / n

			var n = parseInt(prompt('请输入一个数字'))
			var result = 0
			// 因为是3 / 2开始所以i = 2
			for (var i = 2; i <= n; i++) {
				result += (i + 1) / i
			}
			alert(result)
		</script>
	</body>
</html>
